<template>
    <span class="col" @click="myEvent">
        <img :src="like == false ? require('../../assets/images/det-col.png') : require(`../../assets/style-images/det-col-red-${themes.theme}.png`)" alt="">
		{{like == false ? '收藏' : '取消'}}
    </span>
</template>

<script>
 import {mapState} from 'vuex'
 export default {
   data () {
     return {
        like:  this.favoriteStatus
     }
   },
   props: {
        favoriteStatus: {
            type: Boolean
        }
   },
   watch: {
       favoriteStatus(val) {
            this.like = val   
       }
   },
   methods: {
       myEvent() {
        //  this.favoriteStatus
            this.like = !this.like
            this.$emit("myEvent",this.like);  
       }
   },
    computed: {
        ...mapState(['themes']),
    },
   components: {

   }
 }
</script>

<style>
    .det-name .col img{
        display: block;
        margin: auto;
        width: 14px;
        height: 14px;
    }
 
</style>
